<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>分享助手</title>
    <style>
		body{
			margin: 0;
			padding: 0;
		}
		.mtf-m{
			height: 30px;
			background: #F7F7F7;
			text-align:center;
		}
		.mtf-m a{
			display: block;
			width: 30px;
			border: 1px solid #FFFFFF;
			line-height: 28px;
			cursor: pointer;
		}
		.mtf-m div{
			line-height: 30px;
		}
		#mtf-p,#mtf-m{
			font-size: 12px;
		}
		#mtf-c,#mtf-p{
			float:left;
		}
		#mtf-hf,#mtf-hb,#mtf-m{
			float:right;
		}
		#mtf-t{
			white-space: nowrap;
			overflow: hidden;
		}
		#mAddressBar{
			width:100%;
			z-index:1;
		}
		.none{
			display:none;
		}
	</style>
</head>
<body>
<div class="mtf-m">
	<a id="mtf-c">×</a><a id="mtf-p"></a><a id="mtf-hb"><</a><a id="mtf-hf">></a><a id="mtf-m"></a><div id="mtf-t"></div>
	<div id="mAddressBar" class="none"></div>
</div>
<script type="text/javascript">
	var URL='';
    apiready = function(){
		var o=function(i){
			return document.getElementById(i);
		},u2n=function(u,z){
			var a=document.createElement('A');a.href=u;
			return a.host?a.host.replace(/\./g,'_').replace(/\:/g,'_'):z;
		},n=u2n(api.pageParam.url,'newF'),hb=function(){
			api.historyBack({frameName:n},function(ret,err){
				db('mtf-hf');
			    if(!ret.status){
			         api.closeWin();
			     }
		   	});
		},hf=function(){
			api.historyForward({
				frameName:n
			}, function(ret, err) {
				if (!ret.status) {
					dn('mtf-hf');
				}
			});
		},dn=function(i){
			o(i).style.display='none';
		},db=function(i){
			o(i).style.display='block';
		},y=30;
		api.openFrame({
			name:n,
			url:api.pageParam.url,
			rect:{
				y:y
			},
			progress:{
				type:'page'	
			},
			allowEdit:true
		});
		api.setFrameClient({
			frameName:n
		}, function(ret, err) {
			switch (ret.state) {
				case 0:
					break;
				case 1:
					var p=ret.progress,s='';
					if(p===100){
						s='O';
					}else{
						s=p+'%';
					}
					o("mtf-p").innerHTML=s;
					break;
				case 2:
					var j='mtfloadjs=function(){var l=function(){},c={},f={},u={};function s(e,n){if(e){var t=u[e];if(f[e]=n,t)for(;t.length;)t[0](e,n),t.splice(0,1)}}function o(e,n){e.call&&(e={success:e}),n.length?(e.error||l)(n):(e.success||l)(e)}function h(t,r,i,c){var s,o,e=document,n=i.async,f=(i.numRetries||0)+1,u=i.before||l,a=t.replace(/^(css|img)!/,"");c=c||0,/(^css!|\.css$)/.test(t)?(s=!0,(o=e.createElement("link")).rel="stylesheet",o.href=a):/(^img!|\.(png|gif|jpg|svg)$)/.test(t)?(o=e.createElement("img")).src=a:((o=e.createElement("script")).src=t,o.async=void 0===n||n),!(o.onload=o.onerror=o.onbeforeload=function(e){var n=e.type[0];if(s&&"hideFocus"in o)try{o.sheet.cssText.length||(n="e")}catch(e){n="e"}if("e"==n&&(c+=1)<f)return h(t,r,i,c);r(t,n,e.defaultPrevented)})!==u(t,o)&&e.head.appendChild(o)}function t(e,n,t){var r,i;if(n&&n.trim&&(r=n),i=(r?t:n)||{},r){if(r in c)throw"LoadJS";c[r]=!0}!function(e,r,n){var t,i,c=(e=e.push?e:[e]).length,s=c,o=[];for(t=function(e,n,t){if("e"==n&&o.push(e),"b"==n){if(!t)return;o.push(e)}--c||r(o)},i=0;i<s;i++)h(e[i],t,n)}(e,function(e){o(i,e),s(r,e)},i)}return t.ready=function(e,n){return function(e,t){e=e.push?e:[e];var n,r,i,c=[],s=e.length,o=s;for(n=function(e,n){n.length&&c.push(e),--o||t(c)};s--;)r=e[s],(i=f[r])?n(r,i):(u[r]=u[r]||[]).push(n)}(e,function(e){o(n,e)}),t},t.done=function(e){s(e,[])},t.reset=function(){c={},f={},u={}},t.isDefined=function(e){return e in c},t}();mtfloadjs(["//cdn.dm126.com/share/mtfFrame.js"], "mtf");mtfloadjs.ready("mtf", function(){mtfFrame.longTouch.img();});';
					api.execScript({
						frameName: n,
						script: j
					});
					break;
				case 3:
					o("mtf-t").innerHTML=ret.title;
					break;
				case 4:
					o("mtf-m").innerHTML='+<sup>'+api.connectionType+'</sup>';
					URL=ret.url;
					if(mtfAddressBar){
						mtfAddressBar.V.i.value=URL;
					}
					break;
				default:
					break;
			}
		});
		api.addEventListener({
		    name:'keyback'
		}, function(ret, err){
		    hb();
		});
		o("mtf-hb").onclick=function(){
			hb();
		};
		o("mtf-hf").onclick=function(){
			hf();
		};
		o("mtf-c").onclick=function(){
			api.closeWin();
		};
		o("mtf-p").onclick=function(){
			api.execScript({
				frameName: n,
				script: 'location.reload();'
			});
		};
		o("mtf-m").onclick=function(){
			var a=o("mAddressBar"),s=a.style.display,_y;
			if(!s||s==='none'){
				a.style.display='inline-block';
				_y=y+30;
			}else{
				a.style.display='none';
				_y=y;
			}
			api.setFrameAttr({
				name:n,
				rect:{
					y:_y
				}
			});
		};
		dn('mtf-hf');
    };
</script>
<script type="text/javascript" src="//cdn.dm126.com/share/mtfFrame.js" ></script>
<script type="text/javascript" src="//cdn.dm126.com/share/mtfAddressBar.js" ></script>
<script>
	mtfAddressBar.add(document.getElementById('mAddressBar'),function(){
		var i=mtfAddressBar.V.i,b=mtfAddressBar.V.b;
		i.value=URL;
		b[0].type='button';b[1].type='button';
		mtfAddressBar.U.css(i,{"width":"60%"});
	});
</script>
</body>
</html>